package com.dolphin.common.component.var.enums;

import java.util.Collections;
import java.util.List;
import java.util.Objects;

/**
 * @author shida
 */
public interface ValueTypeFunction {

    default Boolean eq(Object realValue,String needValue){
        return Objects.equals(realValue.toString(), needValue);
    }

    default int compareTo(Object realValue, String needValue){
        return 0;
    }

    default Boolean in(Object realValue, List<String> needValues){
        return needValues.contains(realValue.toString());
    }

    default Boolean lk(Object realValue, String needValue){
        return false;
    }

    /**
     *
     * @param realValue
     * @param needValues
     * @return
     */
    default Boolean startAndEnd(Object realValue, List<String> needValues){
        return false;
    }

    /**
     * 交集
     *
     * @param realValue
     * @param needValues
     * @return
     */
    default List<String> intersection(Object realValue, List<String> needValues){
        return Collections.emptyList();
    }
}
